package main

import (
	"fmt"
	"reflect"
)

func main() {
	person := Person{"zhangsan", 20}
	fmt.Println(person)
	// 通过反射获取标签信息
	typeOf := reflect.TypeOf(person)
	field, _ := typeOf.FieldByName("Name")
	fmt.Println(field.Tag)	//获取tag
}

// 带标签的结构体
type Person struct {
	Name string "this is person name"
	Age int32 "this is person age"
}
